﻿using System.Drawing;

namespace Marmat.Forms
{
    public partial class CheckBox
    {

        /// <summary>
        /// 将 System.Windows.Forms.Control.Size 属性重置为其默认值。
        /// </summary>
        protected internal void ResetSize()
        {
            this.Size = new Size(100, 22);
        }

        /// <summary>
        /// 是否应该序列化 Size 属性。
        /// </summary>
        /// <returns></returns>
        protected internal bool ShouldSerializeSize()
        {
            return !(this.Size.Width == 100 && this.Size.Height == 22);
        }

        /// <summary>
        /// 将 System.Windows.Forms.Control.Text 属性重置为其默认值。
        /// </summary>
        public override void ResetText()
        {
            this.Text = null;
        }

        /// <summary>
        /// 是否应该序列化 Text 属性。
        /// </summary>
        /// <returns></returns>
        protected bool ShouldSerializeText()
        {
            return this.Text != default;
        }
    }
}